package com.banmao.c01_factory_method.factory;

import com.banmao.c01_factory_method.vehicle.Vehicle;
import com.banmao.c01_factory_method.vehicle.car.Bus;
import com.banmao.c01_factory_method.vehicle.car.Laosilaisi;

public class CarFactory extends VehicleFactory {

    @Override
    Vehicle newVehicle(String type) {
        Vehicle vehicle = null;
        switch (type) {
            case "bus": {
                vehicle = new Bus();
                break;
            }
            case "laosilaisi":
                vehicle = new Laosilaisi();
                break;
            default: {
                vehicle = new Bus();
            }
        }
        return vehicle;
    }

}
